JBoss.orgCommunity Documentation

Chapter 3. Mobicents XML Document Management Server

3.1. Configuring the XDM Server
3.1.1. Configuring the XDM Server XCAP root
3.1.2. Other configurations in the XDM Server XCAP Interface
3.1.3. Configuring the XDM Server XCAP Diff SIP Subscription Interface
3.1.4. XDM Server User Profile Provisioning
3.1.5. XCAP Application Usages

The Mobicents XML Document Management Server (XDM Server) is part of the Mobicents SIP Presence Service; it is the first free and open source implementation of an XML Document Management Server as defined in the Open Mobile Alliance (OMA) XML Document Management v1.1 specification. This functional element of next-generation IP communication networks is responsible for handling the management of user XML documents stored on the network side, such as presence authorization rules, contact and group lists (also known as resource lists), static presence information, and much more.

Important

The SIP interface partially implements the XCAP Diff Event IETF draft, version 3. Subscriptions to a single document or usage by an entire application are supported. However, these differing usages do not extend to the single-XML element or attribute value level. Regarding the notifications, the diff-processing subscription parameter, if present, is ignored, and patching of content is not available at the moment, which means that only the document etags, new and/or old, will be provided.

The XDM Server comprises the following functional elements:

Functional Elements of the XDM Server

Data Source

The XDM Server data source is where all user XML documents are stored. Information related to the server itself is also stored in this element along with the user's provisioned data

The data source also handles subscriptions to updates on specific documents, or complete XCAP application usages.

Aggregation Proxy

The aggregation proxy is responsible for handling an XDM client's XCAP requests

Authentication Proxy

The authentication proxy is responsible for authentication of the user related with each XCAP request handled.

Request Processor

This element includes the XCAP Server logic to process an XCAP request and return a proper response, including authorization for the authenticated user.

XDM Event Subscription Control

This element, using the SIP protocol, is responsible for handling subscriptions to documents managed by the XDM. Its functions include the authentication and authorization of a subscription, attachment to update events on specific documents or application usages, and the sending of notifications when documents change.

What is an XCAP Application Usage?

"Each XCAP resource on a server is associated with an application. In order for an application to use those resources, application specific conventions must be specified. Those conventions include the XML schema that defines the structure and constraints of the data, well-known URIs to bootstrap access to the data, and so on. All of those application specific conventions are defined by the application usage." RFC 4825

Each XCAP Application Usage defines:

The Mobicents XDM Server XCAP Application Usages are implemented with a few simple Java classes and some meta data, it is very easy to develop additional ones.

Each Application Usage is represented by a Java class extending the abstract org.mobicents.xdm.server.appusage.AppUsage class:



package org.mobicents.xcap.server.slee.appusage.presrules;
// ...
public class PresRulesAppUsage extends AppUsage {
    public static final String ID = "pres-rules";
    public static final String DEFAULT_DOC_NAMESPACE = "urn:ietf:params:xml:ns:pres-rules";
    public static final String MIMETYPE = "application/auth-policy+xml";
    private static final String AUTH_ONLY_DOCUMENT_NAME = index;
    public PresRulesAppUsage(Validator schemaValidator) {
        super(ID,DEFAULT_DOC_NAMESPACE,MIMETYPE,schemaValidator,AUTH_ONLY_DOCUMENT_NAME);
    }
}
            

Methods for data constraints and resource interdependencies can be overriden:



public void checkConstraintsOnPut();
public void checkConstraintsOnDelete();
public void processResourceInterdependenciesOnPutDocument();
public void processResourceInterdependenciesOnDeleteElement();
//...
            

Multiple constructors exposed to provide your App Usage XML Schemas Validators and/or Authorization Policies:



public AppUsage(String auid, String defaultDocumentNamespace, String mimetype, 
    Validator schemaValidator, String authorizedUserDocumentName);
public AppUsage(String auid, String defaultDocumentNamespace, String mimetype, 
    Validator schemaValidator, AuthorizationPolicy authorizationPolicy);
public AppUsage(String auid, String defaultDocumentNamespace, String mimetype, 
    Validator schemaValidator, Validator uniquenessSchemaValidator, 
    String authorizedUserDocumentName);
public AppUsage(String auid, String defaultDocumentNamespace, String mimetype, 
    Validator schemaValidator, Validator uniquenessSchemaValidator,
    AuthorizationPolicy authorizationPolicy);
            

A deployer to load/unload the App Usage into the XDM Server, it should extend class named org.mobicents.xdm.server.appusage.AppUsageDeployer:



package org.mobicents.xcap.server.slee.appusage.presrules;
// ...
public class PresRulesAppUsageDeployer extends AppUsageDeployer {
    
    @Override
    public AppUsageFactory createAppUsageFactory(Schema schema) {
        return new PresRulesAppUsageFactory(schema);
    }
    @Override
    public String getSchemaRootNamespace() {
        return PresRulesAppUsage.DEFAULT_DOC_NAMESPACE;
    }
}
            

Multiple XML schema files may be combined, starting point is the namespace returned by getSchemaRootNamepsace(), which not always is the same as the app usage's default doc namespace.

The deployer is actually a JBoss Microcontainer Bean, and a jboss-beans.xml file is needed in the META-INF directory of the app usage jar:



<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="urn:jboss:bean-deployer:2.0">
        
    <!-- Registers the APP USAGE DEPLOYER AS JBOSS MICROCONTAINER BEAN -->
    
    <bean name="Mobicents.XDMS.AppUsage.Deployer.PresRules" class="org.mobicents.xcap.server.slee.appusage.presrules.PresRulesAppUsageDeployer">           
      <!-- this app usage depends on app usage management only -->
      <depends>Mobicents.XDMS.AppUsageManagement</depends>      
   </bean>
   
</deployment>
            
            

A unique bean “name” is need, and of course the “class” name of the Deployer, nothing else needs to be changed.